package proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * Created by Administrator on 2018/6/8.
 */
public class Myproxy implements InvocationHandler {
    //将要代理的真实对象
    private Object obj;
    Myproxy(Object obj){
        this.obj = obj;
    }
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("前置代理---");
        method.invoke(obj,args);
        System.out.println("后置代理----");
        return null;
    }
}
